//通过声明的方式

interface PointType2 {
  x: number;
  y: number;
  z?: number;
}

function printPosition(point: PointType2) {
  console.log(point.x);
  console.log(point.y);
  console.log(point.z);
}
